﻿<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
<div class="chart-container" style="position: relative; height:40vh; width:80vw">
    <canvas id="myChart"></canvas>
</div>
<script>
    var ctx = document.getElementById('myChart').getContext('2d');
    // 饼形图
    var myPieChart = new Chart(ctx, {
        type: "pie",
        data:{
            datasets: [
                {
                    data: [10, 20, 30], 
                    backgroundColor: 'rgb(255, 99, 132)',
                    borderColor: 'rgb(255, 99, 132)',
                }
            ],
            // These labels appear in the legend and in the tooltips when hovering different arcs
            labels: ["Red", "Yellow", "Blue"]
        },
        options: {}
    });
</script>